package com.hrzyit.whistle.cases.data.api

import com.hrzyit.base.data.protocol.BaseResp
import com.hrzyit.whistle.cases.data.bean.UploadInfo
import io.reactivex.Observable
import okhttp3.MultipartBody
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part

// import rx.Observable

/**
 * 上传相关操作 API 接口
 * @author YangWei
 * @date 2019/3/31
 */
interface UploadApi {

    /**
     * 上传图片文件
     * @author YangWei
     * @date 2019/3/31
     * @param partList  上传文件对象 {@List<MultipartBody.Part>}
     * @return BaseResp<UploadInfo>
     */
    @Multipart
    @POST(value = "file/upload")
    fun upload(
        @Part partList: List<MultipartBody.Part>
    ): Observable<BaseResp<UploadInfo>>

    /**
     *  上传音频文件
     * @author YangWei
     * @date 2019/4/13
     * @param partList 上传文件对象 {@List<MultipartBody.Part>}
     * @return BaseResp<UploadInfo>
     */
    @Multipart
    @POST(value = "file/uploadSound")
    fun uploadRecordAudio(
        @Part partList: List<MultipartBody.Part>
    ): Observable<BaseResp<UploadInfo>>
}